package com.bestcem.xm.ticket.enums;

import lombok.Getter;

/**
 * 数据状态枚举
 *
 * @author jy.zhao
 * @version 1.0
 * @date 2021/8/17 14:54
 **/
@Getter
public enum SMSRecordTypeEnum {
    /**
     * 预警通知
     */
    ALERT(0, "预警通知"),

    /**
     * 工单通知
     */
    TICKET(1, "工单通知"),

    /**
     * 答题验证
     */
    REPLY(2, "答题验证"),

    /**
     * 预警通知
     */
    TEST(3, "中奖通知"),

    /**
     * 抽奖验证
     */
    LOTTERY(4, "抽奖验证"),

    /**
     * 二次投放
     */
    DELIVER_TWICE(5, "二次投放"),

    /**
     * 通知提醒
     */
    NOTIFICATION(6, "通知提醒");

    private final String name;

    private final int index;

    SMSRecordTypeEnum(int index, String name) {
        this.name = name;
        this.index = index;
    }

    public static SMSRecordTypeEnum getByIndex(Integer index) {
        for (SMSRecordTypeEnum value : values()) {
            if (value.getIndex() == index) {
                return value;
            }
        }
        return null;
    }
}
